﻿using System;
using System.IO;

namespace PhotoKiosk.Model
{
    public class Photo
    {
        public string FilePath
        {
            private set;
            get;
        }

        public int NumberOfCopies
        { set; get; }

        private string _fileName = string.Empty;
        public string FileName
        {
            get
            {
                if (_fileName == string.Empty)
                {
                    _fileName = Path.GetFileName(FilePath);
                }
                return _fileName;
            }
        }

        private string _fileExtension = string.Empty;
        public string FileExtension
        {
            get
            {
                if (_fileExtension == string.Empty)
                {
                    _fileExtension = Path.GetExtension(FilePath);
                }
                return _fileExtension;
            }
        }

        private string _fileDirectory = string.Empty;
        public string FileDirectory
        {
            get
            {
                if (_fileDirectory == string.Empty)
                {
                    _fileDirectory = Path.GetDirectoryName(FilePath);
                }
                return _fileDirectory;
            }
        }

        public Photo(string i_FilePath)
        {
            FilePath = i_FilePath;
            NumberOfCopies = 0;
        }
    }
}
